
public class Test {
//    //直接使用{}
//    {
//        int a = 10;
//    }

    private int a;
    private int b;
    public int c;
    public static int d;

    {
        this.a = 10;
        this.b = 20;
        this.c = 5;
    }
    public void show() {
        System.out.println(this.a + " " + this.b + " " + this.c);
    }
//    static {
//        d = 1;
//        a = 2;
//        b = 3;
//        Test test = new Test();
//        test.c = 4;
//    }

    /*public int b;
    public int c;
    public static void fuc(){
        System.out.println("静态变量：" + a);
        fuc0();
        Test test = new Test();
        System.out.println("非静态变量：" + test.b + " " + test.c);
    }
    public static void fuc0() {
        System.out.println("静态方法");
    }
    public void fuc1() {
        System.out.println("静态变量：" + a);
        Test test = new Test();
        System.out.println("非静态变量：" + test.b + " " + test.c);
    }*/
    public static void main(String[] args) {
        /*Test.fuc();
        System.out.println("------------");
        Test test = new Test();
        test.fuc1();*/

        Test test = new Test();
        test.show();
    }
}
